-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DWS | Task 1 | Ершов Вадим #19
Conversation
src/main/java/ru/vk/itmo/test/vadimershov/utils/MemorySegmentUtil.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/vadimershov/utils/MemorySegmentUtil.java
Outdated
Show resolved
Hide resolved
src/main/java/ru/vk/itmo/test/vadimershov/utils/MemorySegmentUtil.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 10332 lines exceeds the maximum allowed for the inline comments feature.
import static ru.vk.itmo.test.vadimershov.utils.MemorySegmentUtil.toEntity; | ||
import static ru.vk.itmo.test.vadimershov.utils.MemorySegmentUtil.toMemorySegment; | ||
|
||
public class DaoHttpServer extends HttpServer { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Не хватает тут обработок неожиданных ошибок, если вдруг упадет ошибка при обработке, то что мы показывали на предыдущем занятии
Request.METHOD_DELETE | ||
); | ||
|
||
private final ReferenceDao dao; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В полях лучше использовать как можно более абстрактный класс
return new Response(Response.NOT_FOUND, Response.EMPTY); | ||
} | ||
|
||
byte[] value = toByteArray(entry.value()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
тут лишнее копирование, которого можно было бы избежать, но пришлось бы попотеть, чтобы сразу отдавать в ответ из мемори сегмента
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
я посмотрел как реализован write Response до сокета, как я понимаю можно переопределить так чтоб можно было передать сразу byteBuffer, но тут тоже будет аллокация, или я не в ту сторону думаю?
} | ||
|
||
@Override | ||
public CompletableFuture<Void> start() throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
старт и стоп лучше сделать синхронизированными, и сделать защиту всякую, а то если несколько раз вызывать - будут всякие неопределенности
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 10367 lines exceeds the maximum allowed for the inline comments feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 10358 lines exceeds the maximum allowed for the inline comments feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 10358 lines exceeds the maximum allowed for the inline comments feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 10362 lines exceeds the maximum allowed for the inline comments feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 10384 lines exceeds the maximum allowed for the inline comments feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 10384 lines exceeds the maximum allowed for the inline comments feature.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR diff size of 10384 lines exceeds the maximum allowed for the inline comments feature.
* Task 1 | Implement DaoHttpServer * Task 1 | Fix codeclimate * Task 1 | Fix codeclimate 2 * Task 1 | Add report.md * Task 1 | Fix comments * Task 1 | Fix codeclimate * Task 1 | Fix codeclimate * Task 1 | Fix exception handler * Task 1 | Fix exception handler * Task 1 | Fix exception handler --------- Co-authored-by: ruarsv5 <[email protected]> Co-authored-by: atimofeyev <[email protected]>
* Task 1 | Implement DaoHttpServer * Task 1 | Fix codeclimate * Task 1 | Fix codeclimate 2 * Task 1 | Add report.md * Task 1 | Fix comments * Task 1 | Fix codeclimate * Task 1 | Fix codeclimate * Task 1 | Fix exception handler * Task 1 | Fix exception handler * Task 1 | Fix exception handler --------- Co-authored-by: ruarsv5 <[email protected]> Co-authored-by: atimofeyev <[email protected]>
No description provided.